﻿<?

@include_once("services/cropImage.php");
@require_once("services/saveInfo.php");

if (isset($_POST["upload_thumbnail"])) {
	//Get the new coordinates to crop the image.
	$x1 = $_POST["x1"];
	$y1 = $_POST["y1"];
	$w = $_POST["w"];
	$h = $_POST["h"];
	$large_image_location = $_POST["large_image_location"];
	$filename = $_POST["filename"];
	
	$thumb_image_location = $targetLocationFullFrame . "/" . $filename;
	resizeThumbnailImage($thumb_image_location, $large_image_location,$w,$h,$x1,$y1,$thumb_width,$thumb_height);
	
	$thumb_S_image_location = $targetLocationSmallDisplay . "/" . $filename;
	resizeThumbnailImage($thumb_S_image_location, $large_image_location,$w,$h,$x1,$y1,$thumb_width_small,$thumb_height_small);
	
	UpdatePic($filename);
}
?>
<script type="text/javascript" src="script/jquery-1.7.1.min.js"></script>
<!-- Dialog -->
<link rel="stylesheet" href="style/messi.min.css" />
<script src="script/messi.js"></script>

<script type="text/javascript">
var msg = new Messi('อัพโหลดรูปเสร็จสิ้น',
	{
		title: 'Message',
		closeButton: false,
		modal: true
	});
	
	msg.visibleCloseButton(function() {
		window.location="profileInfo.php?profileId=<?=$_GET['profileId']?>";
	});
</script>